<template>
  <div class="admin">
    <el-container>
      <el-aside width="200px">
        <el-menu default-active="2" class="el-menu-vertical-demo" router>
          <el-menu-item index="/admin/dictionary">
            <i class="el-icon-user"></i>
            <span slot="title">首页文案管理</span>
          </el-menu-item>
          <el-menu-item index="/admin/cases">
            <i class="el-icon-s-management"></i>
            <span slot="title">经典案例管理</span>
          </el-menu-item>
          <el-menu-item index="/admin/news">
            <i class="el-icon-news"></i>
            <span slot="title">新闻动态管理</span>
          </el-menu-item>
          <el-menu-item index="/login" @click="outlogin">
            <i class="el-icon-setting"></i>
            <span slot="title">退出登录</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-container>
        <el-main>
          <div class="base-padding">
            <router-view />
          </div>
        </el-main>
        <el-footer>2020@胡巴版权所有</el-footer>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "admin",
  created(){
    // this.sfdl()
  },
  methods: {
    async outlogin(){
      const res = await this.$http.get("/data/get",
        {
          params:{
            view: "系统后台",
            code: "tcdl",
          }
        }
      )
      sessionStorage.removeItem("LL")
    },
    // async sfdl(){
    //   const res = await this.$http.get("/data/get",
    //     {
    //       params:{
    //         view: "系统后台",
    //         code: "sfdl",
    //       }
    //     }
    //   )
    //   console.log(res);
    // }
  },
};
</script>

<style lang="scss" soped>
.admin {
  border-top: 1px solid rgb(238, 238, 238);
}

.base-padding {
  padding: 20px;
}

.el-footer {
  line-height: 60px;
}
</style>

<style>
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>